package com.easymin.weixin.entity;

import java.io.Serializable;
import java.util.Date;

public class ApiLogs implements Serializable {
  private Long id;

  private String appKey;

  private String uri;

  private String ip;

  private Boolean result;

  private String httpMethod;

  private Long nanoTime;

  private Date created;

  private String paramters;

  private static final long serialVersionUID = 1L;

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getAppKey() {
    return appKey;
  }

  public void setAppKey(String appKey) {
    this.appKey = appKey == null ? null : appKey.trim();
  }

  public String getUri() {
    return uri;
  }

  public void setUri(String uri) {
    this.uri = uri == null ? null : uri.trim();
  }

  public String getIp() {
    return ip;
  }

  public void setIp(String ip) {
    this.ip = ip == null ? null : ip.trim();
  }

  public Boolean getResult() {
    return result;
  }

  public void setResult(Boolean result) {
    this.result = result;
  }

  public String getHttpMethod() {
    return httpMethod;
  }

  public void setHttpMethod(String httpMethod) {
    this.httpMethod = httpMethod == null ? null : httpMethod.trim();
  }

  public Long getNanoTime() {
    return nanoTime;
  }

  public void setNanoTime(Long nanoTime) {
    this.nanoTime = nanoTime;
  }

  public Date getCreated() {
    return created;
  }

  public void setCreated(Date created) {
    this.created = created;
  }

  public String getParamters() {
    return paramters;
  }

  public void setParamters(String paramters) {
    this.paramters = paramters == null ? null : paramters.trim();
  }

  @Override
  public boolean equals(Object that) {
    if (this == that) {
      return true;
    }
    if (that == null) {
      return false;
    }
    if (getClass() != that.getClass()) {
      return false;
    }
    ApiLogs other = (ApiLogs) that;
    return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
        && (this.getAppKey() == null ? other.getAppKey() == null : this.getAppKey().equals(
            other.getAppKey()))
        && (this.getUri() == null ? other.getUri() == null : this.getUri().equals(other.getUri()))
        && (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp()))
        && (this.getResult() == null ? other.getResult() == null : this.getResult().equals(
            other.getResult()))
        && (this.getHttpMethod() == null ? other.getHttpMethod() == null : this.getHttpMethod()
            .equals(other.getHttpMethod()))
        && (this.getNanoTime() == null ? other.getNanoTime() == null : this.getNanoTime().equals(
            other.getNanoTime()))
        && (this.getCreated() == null ? other.getCreated() == null : this.getCreated().equals(
            other.getCreated()))
        && (this.getParamters() == null ? other.getParamters() == null : this.getParamters()
            .equals(other.getParamters()));
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
    result = prime * result + ((getAppKey() == null) ? 0 : getAppKey().hashCode());
    result = prime * result + ((getUri() == null) ? 0 : getUri().hashCode());
    result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode());
    result = prime * result + ((getResult() == null) ? 0 : getResult().hashCode());
    result = prime * result + ((getHttpMethod() == null) ? 0 : getHttpMethod().hashCode());
    result = prime * result + ((getNanoTime() == null) ? 0 : getNanoTime().hashCode());
    result = prime * result + ((getCreated() == null) ? 0 : getCreated().hashCode());
    result = prime * result + ((getParamters() == null) ? 0 : getParamters().hashCode());
    return result;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append(getClass().getSimpleName());
    sb.append(" [");
    sb.append("Hash = ").append(hashCode());
    sb.append(", id=").append(id);
    sb.append(", appKey=").append(appKey);
    sb.append(", uri=").append(uri);
    sb.append(", ip=").append(ip);
    sb.append(", result=").append(result);
    sb.append(", httpMethod=").append(httpMethod);
    sb.append(", nanoTime=").append(nanoTime);
    sb.append(", created=").append(created);
    sb.append(", paramters=").append(paramters);
    sb.append(", serialVersionUID=").append(serialVersionUID);
    sb.append("]");
    return sb.toString();
  }
}
